All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.awt.Spinner

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----symantec.itools.awt.Spinner

public class Spinner
extends Panel
implements Orientation
This abstract class is used to create spinners. A spinner is a component with two small direction buttons that lets the user scroll a list of predetermined values to select one, or possibly enter a new legal value.

See Also:
ListSpinner, NumericSpinner

Variable Index

 o current
The current selection value.
 o increment
Amount the current value changes when scrolling up or down.
 o max
The maximum possible value.
 o min
The minimum possible value.
 o ORIENTATION_DEFAULT
The default orientation of the spinner buttons (vertical).
 o text
The text of the current selection.
 o textField
The optional text field for this spinner.
 o textWidth
The width of the optional text field for this spinner, in columns.

Constructor Index

 o Spinner()
Construct an empty Spinner.

Method Index

 o addNotify()
Tells this component that it has been added to a container.
 o getCurrent()
Gets the current value of the spinner.
 o getCurrentText()
Gets the currently selected string from the list.
 o getDelay()
Returns the current delay between notification events of the spinner buttons in milliseconds.
 o getEditable()
Returns whether the Spinner's TextField is editable.
 o getMax()
Gets the current maximum value the spinner may have.
 o getMin()
Gets the current minimum value the spinner may have.
 o getNotifyWhilePressed()
Gets the current notifyWhilePressed status.
 o getOrientation()
Gets the current orientation of the spin buttons.
 o getWrappable()
Gets whether the current value can wrap around from maximum to minimum and from minimum to maximum.
 o handleEvent(Event)
Processes events for this component.
 o paint(Graphics)
Paints this component using the given graphics context.
 o scrollDown()
Decrements the spinner's value and handles wrapping as needed.
 o scrollUp()
Increments the spinner's value and handles wrapping as needed.
 o setCurrent(int)
Sets the value of the spinner.
 o setDelay(int)
Sets the notification event delay of the spinner buttons in milliseconds.
 o setEditable(boolean)
Conditionally enables editing of the Spinner's TextField.
 o setLayout(LayoutManager)
Takes no action.
 o setMax(int)
Sets the maximum value the spinner may have.
 o setMin(int)
Sets the minimum value the spinner may have.
 o setNotifyWhilePressed(boolean)
Sets whether the spinner buttons will continually post notify events while pressed.
 o setOrientation(int)
Sets the orientation of the spin buttons.
 o setWrappable(boolean)
Conditionally sets whether the current value wraps around from maximum to minimum and from minimum to maximum.
 o updateText()
Updates the text field with the current text, as needed.

Variables

 o ORIENTATION_DEFAULT
  public final int ORIENTATION_DEFAULT
The default orientation of the spinner buttons (vertical).

 o min
  protected int min
The minimum possible value.

 o max
  protected int max
The maximum possible value.

 o current
  protected int current
The current selection value. min <= current <= max.

See Also:
min, max
 o text
  protected String text
The text of the current selection.

 o textWidth
  protected int textWidth
The width of the optional text field for this spinner, in columns.

 o textField
  protected TextField textField
The optional text field for this spinner.

 o increment
  protected int increment
Amount the current value changes when scrolling up or down.

Constructors

 o Spinner
  protected Spinner()
Construct an empty Spinner. It has the default orientation, an increment of 1, no text field, and minimum, maximum, and current values of 0.

Methods

 o setEditable
  public void setEditable(boolean f)
Conditionally enables editing of the Spinner's TextField.

Parameters:
f - true = allow editing; false = disallow editing
 o getEditable
  public boolean getEditable()
Returns whether the Spinner's TextField is editable.

Returns:
true if the TextField can be edited, false otherwise
 o setWrappable
  public void setWrappable(boolean f)
Conditionally sets whether the current value wraps around from maximum to minimum and from minimum to maximum.

Parameters:
f - if true the value can wrap
See Also:
getWrappable
 o getWrappable
  public boolean getWrappable()
Gets whether the current value can wrap around from maximum to minimum and from minimum to maximum.

Returns:
true if the value can wrap
See Also:
setWrappable
 o setMin
  public void setMin(int i)
Sets the minimum value the spinner may have.

Parameters:
i - the new minimum value
See Also:
getMin
 o getMin
  public int getMin()
Gets the current minimum value the spinner may have.

Returns:
the current minimum value
See Also:
setMin
 o setMax
  public void setMax(int i)
Sets the maximum value the spinner may have.

Parameters:
i - the new maximum value
See Also:
getMax
 o getMax
  public int getMax()
Gets the current maximum value the spinner may have.

Returns:
the current maximum value
See Also:
setMax
 o setCurrent
  public void setCurrent(int i)
Sets the value of the spinner.

Parameters:
i - the new value
See Also:
getCurrent
 o getCurrent
  public int getCurrent()
Gets the current value of the spinner.

Returns:
the current spinner value
See Also:
setCurrent
 o setOrientation
  public void setOrientation(int o)
Sets the orientation of the spin buttons.

Parameters:
o - the new orientation: ORIENTATION_VERTICAL, ORIENTATION_HORIZONTAL, or ORIENTATION_DEFAULT
See Also:
getOrientation, ORIENTATION_VERTICAL, ORIENTATION_VERTICAL, ORIENTATION_DEFAULT
 o getOrientation
  public int getOrientation()
Gets the current orientation of the spin buttons.

Returns:
the current orientation, ORIENTATION_VERTICAL or ORIENTATION_HORIZONTAL
See Also:
setOrientation, ORIENTATION_VERTICAL, ORIENTATION_VERTICAL
 o setNotifyWhilePressed
  public void setNotifyWhilePressed(boolean f)
Sets whether the spinner buttons will continually post notify events while pressed.

Parameters:
f - true = post notify events; false = do not post events
See Also:
getNotifyWhilePressed, setDelay, getDelay
 o getNotifyWhilePressed
  public boolean getNotifyWhilePressed()
Gets the current notifyWhilePressed status.

Returns:
true if notify events posted while pressed, false otherwise
See Also:
setNotifyWhilePressed, setDelay, getDelay
 o setDelay
  public void setDelay(int d)
Sets the notification event delay of the spinner buttons in milliseconds.

Parameters:
d - the delay between notification events in milliseconds
See Also:
setNotifyWhilePressed, getDelay
 o getDelay
  public int getDelay()
Returns the current delay between notification events of the spinner buttons in milliseconds.

See Also:
setNotifyWhilePressed, setDelay
 o handleEvent
  public boolean handleEvent(Event e)
Processes events for this component. This is a standard Java AWT method which gets called by the AWT to handle this component's events. The default handler for components dispatches to one of the following methods as needed: action(), gotFocus(), lostFocus(), keyDown(), keyUp(), mouseEnter(), mouseExit(), mouseMove(), mouseDrag(), mouseDown(), or mouseUp().

Parameters:
e - the event to handle
Returns:
true if the event was handled and no further action is needed, false to pass the event to this component's parent
Overrides:
handleEvent in class Component
See Also:
action, gotFocus, lostFocus, keyDown, keyUp, mouseEnter, mouseExit, mouseMove, mouseDrag, mouseDown, mouseUp
 o addNotify
  public void addNotify()
Tells this component that it has been added to a container. This is a standard Java AWT method which gets called by the AWT when this component is added to a container. Typically, it is used to create this component's peer. Here it's used to setup the component, creating the TextField as needed.

Overrides:
addNotify in class Panel
See Also:
removeNotify
 o paint
  public void paint(Graphics g)
Paints this component using the given graphics context. This is a standard Java AWT method which typically gets called by the AWT to handle painting this component. It paints this component using the given graphics context. The graphics context clipping region is set to the bounding rectangle of this component and its <0,0> coordinate is this component's top-left corner.

Parameters:
g - the graphics context used for painting
Overrides:
paint in class Container
See Also:
repaint, update
 o scrollUp
  protected void scrollUp()
Increments the spinner's value and handles wrapping as needed.

See Also:
scrollDown, increment
 o scrollDown
  protected void scrollDown()
Decrements the spinner's value and handles wrapping as needed.

See Also:
scrollUp, increment
 o updateText
  protected void updateText()
Updates the text field with the current text, as needed.

See Also:
getCurrentText
 o getCurrentText
  protected abstract String getCurrentText()
Gets the currently selected string from the list.

Returns:
the string currently visible in the Spinner
See Also:
updateText
 o setLayout
  public void setLayout(LayoutManager lm)
Takes no action. This is a standard Java AWT method which gets called to specify which layout manager should be used to layout the components in standard containers. Since layout managers CANNOT BE USED with this container the standard setLayout has been OVERRIDDEN for this container and does nothing.

Parameters:
l - the layout manager to use to layout this container's components (IGNORED)
Overrides:
setLayout in class Container
See Also:
getLayout

All Packages  Class Hierarchy  This Package  Previous  Next  Index